package com.manage.competition.service;

import com.manage.competition.entity.*;
import com.manage.competition.vo.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * Create with IDEA
 *
 * @Author: gitee.com/KamisamaXX
 * @Date: Create in 19:44 2019/3/24
 * @Description:
 */
public interface ICompetitionService {
    /**
     * 查找竞赛
     * @param status
     * @return
     */
    List<CompetitionVo> findCompetitionListByStatus(int status);

    /**
     * 新增竞赛
     * @return
     */
    long newCompetition();

    /**
     * 发布竞赛
     * @param competitionId
     * @return
     */
    int publishCompetition(long competitionId);



    /**
     * 报名信息设置填空
     * @param title
     * @param type
     * @return
     */
    int setFillItem(String title,boolean type);

    /**
     * 报名信息设置单项选择
     * @param title
     * @param options
     * @param type
     * @return
     */
    int setSingleOption(String title, String options, boolean type);

    /**
     * 报名信息设置双项选择
     * @param title
     * @param firstOptions
     * @param secondOptions
     * @param type
     * @return
     */
    int setDoubleOption(String title, String firstOptions, String secondOptions, boolean type);

    /**
     * 获取报名信息
     * @return
     */
    SignUpInfoVo getSignUpInfo();

    /**
     * 删除报名项
     */
    int deleteOption(long id);

    /**
     * 获取宣传图片
     * @param type
     * @return
     */
    String getAdvertisePicture(String type);

    /**
     * 删除图片
     * @param type
     * @return
     */
    int deleteAdvertisePicture(String type);

    /**
     * 上传图片
     * @param file
     * @return
     */
    String upload(MultipartFile file,String type);

    /**
     * 设置竞赛基本信息
     * @param competitionInformation
     * @return
     */
    int setCompetitionInformation(CompetitionInformation competitionInformation);

    /**
     * 获取竞赛基本信息
     * @return
     */
    CompetitionInformationVo getCompetitionInformation();

    /**
     * 报名竞赛
     * @param competitionId
     * @return
     */
    int enrollCompetition(long competitionId);

    /**
     * 收集报名信息
     * @return
     */
    int enrollCompetitionMessage(EnrollMessageVo vo);

    /**
     * 获取竞赛联系人信息
     * @return
     */
    ContactVo getContact();

    /**
     * 获取竞赛组织者信息
     * @return
     */
    OrganizerVo getOrganizer();

    /**
     * 设置联系人信息
     * @param contact
     * @return
     */
    int setContact(Contact contact);

    /**
     * 主办方信息
     * @param organizer
     * @return
     */
    int setOrganizer(Organizer organizer);


    /**
     * 获取竞赛信息详情
     * @return
     */
    CompetitionVo getCurrentCompetitionDetail();

    /**
     * user接口的获取竞赛详情
     * @param competitionId
     * @return
     */
    CompetitionDetailVo getCompetitionDetail(long competitionId);

    /**
     * 试卷信息
     * @return
     */
    ExaminationPaperVo getExaminationPaper();

    /**
     * 试卷详情
     * @param competitionId
     * @param userId
     * @return
     */
    UserPaperVo getUserExaminationPaper(long competitionId,Long userId);


    /**
     * 设置试卷信息
     * @param paper
     * @return
     */
    int setExamPaper(ExaminationPaper paper);

    /**
     * 获取试卷栏目信息
     * @return
     */
    List<ExaminationColumnVo> getExaminationColumn(long paperId);

    /**
     * 新建试卷栏目
     * @param paperId
     * @return
     */
    Long createExamColumn(long paperId);


    /**
     * 试卷设置栏目
     * @param column
     * @return
     */
    int setExamColumn(ExaminationColumn column);

    /**
     * 创建题目
     * @param columnId
     * @return
     */
    int createExamQuestion(long columnId);

    /**
     * 设置试卷题目
     * @param questions
     * @return
     */
    int setExamQuestion(ExaminationQuestions questions);

    /**
     * 获取试卷题目
     * @param columnId
     * @return
     */
    List<ExaminationQuestionVo> getExaminationQuestion(long columnId);

    /**
     * 获取根据试卷栏目id获取试卷题目
     * @param columnIds
     * @return
     */
    Map<String,List<ExaminationQuestionVo>> getExaminationQuestionByColumn(List<ExaminationColumn> columnIds);

    /**
     * 删除问题
     * @param questions
     * @return
     */
    int deleteExamQuestion(ExaminationQuestions questions);

    /**
     * 删除栏目
     * @param column
     * @return
     */
    int deleteExamColumn(ExaminationColumn column);

    /**
     * 设置当前用户修改的竞赛
     * @param name
     */
    void setCurrentCompetition(Long name);

    /**
     * 获取当前用户修改的竞赛
     * @return
     */
    Long getCurrentCompetition();


    /**
     * 获取已经报名的竞赛
     * @return
     */
    List<CompetitionDetailVo> getEnrollList();

    /**
     * 上传作品
     * @param file
     * @return
     */
    String answerUpload(MultipartFile file, long competitionId,long paperId,long columnId,long questionId);

    /**
     * 查看上传作品
     * @return
     */
    String getUploadAnswer(long questionId);


    /**
     * 获取分配审批的竞赛
     * @return
     */
    List<CompetitionDetailVo> getCompetitionReviewList();

    /**
     * 获取竞赛中提交的答案
     * @return
     */
//    List<UserAnswerVo> getCompetitionAnswerList(long competitionId);

    /**
     * 获取参赛人员
     * @return
     */
    List<UserScoreVo> getEnrollUser(long competitionId);

    /**
     * 评分
     * @param score
     * @param userId
     * @param questionId
     * @return
     */
    int setScore(Integer score, Long userId, Long questionId,Long competitionId);

    /**
     * 获取当前评分
     * @param userId
     * @param questionId
     * @return
     */
    CompetitionScore getScore(Long userId, Long questionId);

    /**
     * 设置竞赛评分的教师
     * @param vo
     * @return
     */
    int setGradeTeacher(GradeTeacherVo vo);

    /**
     * 获取竞赛评分的教师
     * @return
     */
    List<String> getGradeTeacher();

    /**
     * 排行榜
     * @return
     */
    List<ChartsVo> getCharts(Long competitionId);

    /**
     * 结束竞赛
     * @param id
     * @return
     */
    int endCompetition(Long id);

    /**
     * 重新编辑竞赛
     * @param competitionId
     * @return
     */
    int reEditCompetition(long competitionId);

    /**
     * 获取该学生的分数
     * @param userId
     * @param competitionId
     * @return
     */
    Integer getUserScore(Long userId, Long competitionId);

    /**
     * 获取所有评委的评分
     * @param competitionId
     * @param userId
     * @return
     */
    List<TeacherGradeVo> getTeacherGrade(Long competitionId, Long userId, Long questionId);

    /**
     * 删除竞赛
     * @param competitionId
     * @return
     */
    int deleteCompetition(Long competitionId);

//    /**
//     * 管理员查看竞赛细节
//     * @param competitionId
//     * @return
//     */
//    List<UserScoreVo> getEnrollUserAndDetail(long competitionId);
}
